use deadpool_redis::{Pool, Config};
use std::env;
//获取redis连接池
pub fn get_pool() -> Pool {
    let mut cfg = Config::default();
    cfg.url = Some(format!("redis://:{}@{}:{}",
       env::var("REDIS_PASSWORD").unwrap(),
       env::var("REDIS_HOST").unwrap(),
       env::var("REDIS_PORT").unwrap()   
    ));
    cfg.create_pool().unwrap()
}

//全局连接池
lazy_static! { 
    pub static ref REDISPOOL: Pool= {
       
        get_pool()
    };
}